<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <!--[if IE]><script src="../assets/javascript/excanvas.js"></script><![endif]-->
        <script type="text/javascript" src="../lib/util.js"></script>
        <script type="text/javascript" src="../lib/primitives.js"></script>
        <script type="text/javascript" src="../lib/style.js"></script>
        <script type="text/javascript" src="../lib/matrix.js"></script>
        <script type="text/javascript" src="../lib/text.js"></script>
        <script type="text/javascript">

            function getCanvas(){
                var canvas = document.getElementById("a");
                return canvas;
            }

            /**Just get the context*/
            function getContext(){
                var canvas = getCanvas();

                if (window.G_vmlCanvasManager != undefined) { // ie IE
                    window.G_vmlCanvasManager.initElement(canvas);
                }
                return canvas.getContext("2d");
            }

            var t;

            function draw(){
                var canvas  = getCanvas();
                var context = getContext();
                context.clearRect(0,0,600,400);
                var t = new Text("Center - test with \n multiple lines",100,20,"Arial",10,false);
                t.style.fillStyle = '999999'
                t.paint(context);

                 t = new Text("Left - test with \n multiple lines",100,60,"Arial",10,false);
                t.align = Text.ALIGN_LEFT;
                t.paint(context);

                 t = new Text("Right - test with \n multiple lines",100,100,"Arial",10,false);
                t.align = Text.ALIGN_RIGHT;
                t.paint(context);


// valign removed as useless
//                t = new Text("Top - test with \n multiple lines",100,140,"Arial",10,false);
//                t.valign = Text.VALIGN_TOP;
//                t.paint(context);

                t = new Text("Middle - test with \n multiple lines",200,140,"Arial",10,false);
                t.paint(context);

//                t = new Text("Bottom - test with \n multiple lines",300,140,"Arial",10,false);
//                t.valign = Text.VALIGN_BOTTOM;
//                t.paint(context);

                var c = new Connector()
                //context.fillText("test",0,20)
            }
            function passed(message){
                document.write('<span class="passed">' + message + '</span><br/>');
            }

            function failed(message){
                document.write('<span class="failed">' + message + '</span><br/>');
            }

            </script>
        <style type="text/css">
            .failed { color: red;}
            .passed { color: green;}
        </style>
  </head>
    <body onload="javascript: draw();">
    <canvas id="a" style="border: 1px solid gray;" width="600" height="400">no canvas </canvas>
    <input type="button" value="draw" onclick="draw();"><br />
  </body>
</html>
